#ifndef _CEVENTMANAGER_H_
#define _CEVENTMANAGER_H_

#include "auto.h"
#include <buola/gui/x11/cx11dispatcher.h>

namespace buola { namespace bwm {

class CEventManager : public gui::x11::CX11EventFilter, public UUncopiable
{
public:
    CEventManager();
    virtual ~CEventManager();

    void Start();

    void SelectManagerEvents(CClient*);
    void SelectComposerEvents(CClient*);
    void DeselectManagerEvents(CClient*);
    void DeselectComposerEvents(CClient*);

private:
    bool DoMapRequest(XMapRequestEvent *);
    bool DoConfigureRequest(XConfigureRequestEvent *);
    bool DoMapNotify(XMapEvent*);
    bool DoUnmapNotify(XUnmapEvent*);
    bool DoCirculateNotify(XCirculateEvent*);
    bool DoPropertyNotify(XPropertyEvent*);
    bool DoReparentNotify(XReparentEvent*);
    bool DoConfigureNotify(XConfigureEvent*);
    bool DoDestroyNotify(XDestroyWindowEvent*);
    bool DoExpose(XExposeEvent*);
    bool DoButtonPress(XButtonEvent*);
    bool DoButtonRelease(XButtonEvent*);
    bool DoMotionNotify(XMotionEvent*);
    bool DoLeaveNotify(XCrossingEvent*);
    bool DoClientMessage(XClientMessageEvent*);
    bool DoShapeEvent(XShapeEvent*);
    bool DoDamageEvent(XDamageNotifyEvent*);

//Events
    virtual bool OnX11Event(XEvent*);
    virtual bool OnX11BadWindow(Window pID);
};

/*namespace bwm*/ } /*namespace buola*/ }

#endif
